package com.example.demo_mysql_mybatisplus.util.responce.results.filler.demo.interfaceImpls;

import cn.hutool.core.date.DateUtil;
import com.example.demo_mysql_mybatisplus.util.responce.results.filler.demo.entitys.*;
import org.springframework.stereotype.Service;

import java.util.*;

@Service
public class DataInterfaceImpl implements DataInterface {

    @Override
    public AAA getAAA(String byField, List<Object> byFieldVals) {
        return new AAA().setId(11).setName("name_a1").setCode("code_a1").setAge(1) ;
    }

    @Override
    public Object getDDD(String byField, List<Object> byFieldVals) {
        return new DDD().setId(41).setName("name_d1").setCode("code_d1");
//        return null;
    }

    @Override
    public List getCCC(String byField, List<Object> byFieldVals) {
        return Arrays.asList(
                new CCC().setId(31).setName("name_c1").setCode("code_c1"),
                new CCC().setId(32).setName("name_c2").setCode("code_c2")
        );
    }

    @Override
    public Set getEEE(String byField, List<Object> byFieldVals) {
        return new HashSet<EEE>( ){{
            add( new EEE().setId(51).setCode("code_e1").setBirthday(DateUtil.yesterday()).setAge(5111).setName("name_e1") );
            add( new EEE().setId(52).setCode("code_e2").setBirthday(DateUtil.date()) );
            add( new EEE().setId(53).setCode("code_e3").setBirthday(DateUtil.tomorrow()).setAge(5222) );
            add( new EEE().setId(54).setCode("code_e4").setBirthday(DateUtil.lastWeek()) );
        }};
    }

    @Override
    public Collection getFFF(String byField, List<Object> byFieldVals) {
        return new HashSet<FFF>( ){{
            add( new FFF().setId(61L).setName("name_f1").setCode("code_f1").setAge(55555).setBirthday(DateUtil.date()) );
        }};
    }
}